#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Mikan Auth Package

Mikan Python Web Framework
"""

__author__ = "K.Sonohara"
__status__ = "develop"
__version__ = "0.0.0_30"
__date__    = "2013/09/01"
__license__ = 'LGPL'

# ------------------------------------------------------------
## Import Section
# ------------------------------------------------------------
# Python

# Mikan
from mikan.core import AbstractMikanPerform
from mikan.exception import MikanStatusException

# ------------------------------------------------------------
## Variable Section
# ------------------------------------------------------------

# ------------------------------------------------------------
## Function Section
# ------------------------------------------------------------

# ------------------------------------------------------------
## Class Section
# ------------------------------------------------------------
## Mikan 認証 抽象 クラス
class AbstractMikanAuth(AbstractMikanPerform):

	# ----------------------------------------------------
	## コンストラクタ
	#  @param request リクエスト
	def __init__(self, request):
		super(AbstractMikanAuth, self).__init__(request)

## Mikan 認証 抽象 クラス
class MikanBasicAuth(AbstractMikanAuth):

	# ----------------------------------------------------
	## コンストラクタ
	#  @param request リクエスト
	def __init__(self, request):
		super(MikanBasicAuth, self).__init__(request)

	def prepare(self):
		if (self.request.islogined != True):
			raise MikanStatusException(self.request, 401)
		return super(MikanBasicAuth, self).prepare()

# ------------------------------------------------------------
## Main Section
# ------------------------------------------------------------
if __name__ == '__main__':
	pass

# ------------------------------------------------------------
